import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import home　from '@/components/home'
import Main from '@/views/main/Main'
import history from '@/views/main/component/history'
import statistics from '@/views/main/component/statistics'
import detail from '@/views/detail/detail'
// import dialogue from '@/components/dialogue'
import previewer from '@/components/previewer'

Vue.use(Router)

export default new Router({
  // mode: 'history',
  // base: '/dist/',
  routes: [
    {
      path: '/',
      name: 'HelloWorld',
      component: HelloWorld
    },
    {
      path:'/home',
      name:'home',
      component: home
    },
    {
      path: '/main',
      name: 'main',
      component: Main,
      redirect: '/main/history',
      children: [
        // {
        //   path: '',
        //   component: history
        // },
        {
          path: 'history',
          component: history,
          name: 'history'
        },
        {
          path: 'statistics',
          component: statistics,
          name: 'statistics'
        }
      ]
    },
    {
      path: '/detail/:id/:userId',
      name: 'detail',
      component: detail
    },
    {
      path: '/previewer',
      component: previewer
    }
  ]
})
